package com.ppc.ugo.controller;

import com.ppc.ugo.common.cache.Cache;
import com.ppc.ugo.common.log.LogAnnotation;
import com.ppc.ugo.service.CatItemService;
import com.ppc.ugo.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/public/v1/home")
public class CatItemController {
    @Autowired
    private CatItemService catItemService;

    @GetMapping("/catitems")
    @LogAnnotation(module = "首页分类选项", operation = "获取首页分类选项数据")
    @Cache(name = "CatItem", expire = 5 * 60 * 1000)
    public Result getCatItems(){
        return catItemService.getCatItems();
    }

}
